var mongoose = require('mongoose');
mongoose.Promise = global.Promise;
var Schema = mongoose.Schema;
// 时间转化
// function  GMTToStr(time){
//     let date = new Date(time)
//     let Str=date.getFullYear() + '-' +
//         (date.getMonth() + 1) + '-' +
//         date.getDate() + ' ' +
//         date.getHours() + ':' +
//         date.getMinutes() + ':' +
//         date.getSeconds()
//     return Str
// };
// function StrToGMT(time){
//     let GMT = new Date(time)
//     return GMT
// }


var UsersNotes = new Schema({
    address:String,
    note:String,
    reg_time:{type:Date,default:Date.now()}
},{
    versionKey:false,//不显示版本号
})

var NotesModel = mongoose.model('Notes', UsersNotes);
module.exports = NotesModel;